home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / nihcl-30.lha / nihcl-3.0 / lib / _main.c_m next >
Text File  |  1990-05-23  |  1KB  |  55 lines

  1. /* _main.c -- "munch" version with NIH Class Library initialization
  2.  
  3.     THIS SOFTWARE FITS THE DESCRIPTION IN THE U.S. COPYRIGHT ACT OF A
  4.     "UNITED STATES GOVERNMENT WORK".  IT WAS WRITTEN AS A PART OF THE
  5.     AUTHOR'S OFFICIAL DUTIES AS A GOVERNMENT EMPLOYEE.  THIS MEANS IT
  6.     CANNOT BE COPYRIGHTED.  THIS SOFTWARE IS FREELY AVAILABLE TO THE
  7.     PUBLIC FOR USE WITHOUT A COPYRIGHT NOTICE, AND THERE ARE NO
  8.     RESTRICTIONS ON ITS USE, NOW OR SUBSEQUENTLY.
  9.  
  10. Author:
  11.     Ted Persky
  12.     Bg. 12A, Rm. 2031
  13.     Computer Systems Laboratory
  14.     Division of Computer Research and Technology
  15.     National Institutes of Health
  16.     Bethesda, Maryland 20892
  17.     Phone: (301) 496-2963
  18.     uucp: uunet!nih-csl!ted
  19.     December, 1988
  20.  
  21. Function:
  22.     _main is called at execution time before the programmer's
  23.     "main" program.  It runs through the _ctors array
  24.     of constructors and calls them all to initialize static and
  25.     external objects.  It finally calls the nihcl initialization
  26.     routine.
  27.  
  28. Modification History:
  29.  
  30. $Log:    _main.c_m,v $
  31. Revision 3.0  90/05/23  11:01:45  kgorlen
  32. Release for 1st edition.
  33.  
  34. */
  35.  
  36. #include "Object.h"
  37.  
  38. static char RCSID[] = "$Header: /afs/alw.nih.gov/unix/sun4_40c/usr/local/src/nihcl-3.0/share/lib/RCS/_main.c_m,v 3.0 90/05/23 11:01:45 kgorlen Rel $";
  39.  
  40. typedef int (*PFV)();
  41.  
  42. extern PFV _ctors[];
  43.  
  44. #ifdef __cplusplus
  45. extern "C" { extern void _main(); };
  46. #endif
  47.  
  48. extern void _main()
  49. {
  50.     for (int i=0; _ctors[i] != (PFV) 0; i++)
  51.         (*(_ctors[i]))();
  52.  
  53.     NIHCL::initialize();
  54. }
  55.